package org.invigorare.auctions;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class AuctionMenu extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button bSaleForm = (Button)findViewById(R.id.button_auctionsale_form);
        bSaleForm.setOnClickListener(new ClickListener_LaunchActivity(AuctionSaleForm.class));
        
        Button bSaleList = (Button)findViewById(R.id.button_auctionsale_list);
        bSaleList.setOnClickListener(new ClickListener_LaunchActivity(AuctionSaleList.class));
    }

    private class ClickListener_LaunchActivity implements View.OnClickListener {
    	
    	Class<? extends Activity> activityClass;
    	
    	public ClickListener_LaunchActivity(Class<? extends Activity> activityToLaunch) {
    		this.activityClass = activityToLaunch;
    	}
    	
    	public void onClick(View v) {
    	    	Intent myIntent = new Intent(AuctionMenu.this, activityClass);
    	    	AuctionMenu.this.startActivity(myIntent);
    	    }
    }
    
   
    
}